* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.header h1 i {
    margin-right: 10px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.input-section {
    padding: 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.input-group {
    display: flex;
    gap: 10px;
}

#taskInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#taskInput:focus {
    border-color: #667eea;
}

.add-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.add-btn:active {
    transform: translateY(0);
}

.filter-section {
    display: flex;
    padding: 20px;
    gap: 10px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.filter-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e9ecef;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.todo-list {
    max-height: 400px;
    overflow-y: auto;
    background: white;
}

.todo-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    animation: slideIn 0.3s ease;
}

.todo-item:hover {
    background-color: #f8f9fa;
}

.todo-item.completed {
    opacity: 0.7;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #6c757d;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: #667eea;
}

.todo-content {
    flex: 1;
    display: flex;
    align-items: center;
}

.todo-text {
    flex: 1;
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
}

.todo-actions {
    display: flex;
    gap: 8px;
    margin-left: 10px;
}

.edit-btn, .delete-btn {
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.edit-btn {
    background: #e3f2fd;
    color: #1976d2;
}

.edit-btn:hover {
    background: #bbdefb;
}

.delete-btn {
    background: #ffebee;
    color: #d32f2f;
}

.delete-btn:hover {
    background: #ffcdd2;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.empty-state small {
    font-size: 0.9rem;
    opacity: 0.7;
}

.editing {
    background-color: #fff3e0 !important;
}

.edit-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
}

.save-btn {
    background: #4caf50;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.save-btn:hover {
    background: #45a049;
}

.cancel-btn {
    background: #9e9e9e;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.cancel-btn:hover {
    background: #757575;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .stats {
        gap: 20px;
        font-size: 0.8rem;
    }
    
    .input-section {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .add-btn {
        width: 100%;
    }
    
    .filter-section {
        padding: 15px;
    }
    
    .filter-btn {
        font-size: 0.8rem;
        padding: 8px;
    }
    
    .todo-item {
        padding: 12px 15px;
    }
    
    .todo-actions {
        gap: 5px;
    }
    
    .edit-btn, .delete-btn {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
}

/* 滚动条样式 */
.todo-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.todo-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.todo-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
